<template>
	<om-formsub-outer :index="index" :checkedit="checkedit">
		<om-autoform ref="autoform" :initConfigData="autoformdata" :initValue="initValue"></om-autoform>
	</om-formsub-outer>
</template>

<script>
	import {buildSubFormData, subOnLoad, changeEditor,configSelectData,hasValue} from '../../../static/js/formUtil.js';
	import { ignoreHtml,ptFloat,minusF,getDateStr} from '@/static/js/common.js';
	import urlUtil from "@/static/js/urlUtil.js"
	export default {
		provide() {
			return {
				formPage: this
			};
		},
		data() {
			return buildSubFormData({
				bearOffCacheKey:"mkt-dd-salesOrderReview-title9-bearOff-cache",
				evaOffCacheKey:"mkt-dd-salesOrderReview-title9-evaOff-cache"
				
			})
		},
		methods:{
			
		},
		onShow() {
			let _that = this
			if(_that.$refs.autoform){
				uni.getStorage({
					key:_that.bearOffCacheKey,
					success:(res)=>{
						let d = res.data
						let formdata = _that.$refs.autoform.formdata
						formdata.bearOff3Id = d.id
						formdata.bearUser3Name = d.userName
						uni.removeStorage({
							key:_that.bearOffCacheKey
						})
					}
				})
				uni.getStorage({
					key:_that.evaOffCacheKey,
					success:(res)=>{
						let d = res.data
						let formdata = _that.$refs.autoform.formdata
						formdata.evaOff3Id = d.id
						formdata.evaUser3Name = d.userName
						uni.removeStorage({
							key:_that.evaOffCacheKey
						})
					}
				})
			}
		},
		onLoad(e) {
			let _that = this
			subOnLoad(_that, e, function() {
			if(e.configDataCacheKey){
				uni.getStorage({
					key: e.configDataCacheKey,
					success: function(res) {
						if(res.data && Object.prototype.toString.call(res.data)==='[object Array]'){
							_that.autoformdata = res.data
							Object.assign(_that.initValue, _that.formdata)
							_that.autoformdata[0].order = _that.order
							changeEditor('title9','bearOff3Id',{
									link: '../../public/pageSearch/pageSearch',
									"linkParam": {
										other: JSON.stringify({
										}),
										namefield: "userName",
										searchfield: 'q',
										url: urlUtil.officePageUrl().url,
										cachename: _that.bearOffCacheKey,
										placeholder: urlUtil.officePageUrl().prompt
									}
								},null,_that.autoformdata);
							changeEditor('title9','evaOff3Id',{
									link: '../../public/pageSearch/pageSearch',
									"linkParam": {
										other: JSON.stringify({
										}),
										namefield: "userName",
										searchfield: 'q',
										url: urlUtil.officePageUrl().url,
										cachename: _that.evaOffCacheKey,
										placeholder: urlUtil.officePageUrl().prompt
									}
								},null,_that.autoformdata);	
								changeEditor("title9","maxScore","max",10,_that.autoformdata)
								changeEditor("title9","maxScore","min",0,_that.autoformdata)
							}
						}
					})
				}
							
			})
		}
	}
</script>

<style>
</style>                                                                                                                                                                                                                                                                                                                                                                                                                                                  
